Silence protobuf sun.misc.Unsafe warnings from the direct header comp… - #375
Open
davido wants to merge 1 commit into
Open
Silence protobuf sun.misc.Unsafe warnings from the direct header comp…#375davido wants to merge 1 commit into
davido wants to merge 1 commit into
Conversation
davido
force-pushed
the
turbine-direct-unsafe-memory-access
branch
from
August 18, 2026 05:29
cf27565 to
68de125
Compare
hvadehra
requested changes
Aug 19, 2026
davido
force-pushed
the
turbine-direct-unsafe-memory-access
branch
from
August 19, 2026 13:04
68de125 to
8d5a82c
Compare
hvadehra
requested changes
Aug 19, 2026
davido
force-pushed
the
turbine-direct-unsafe-memory-access
branch
from
August 19, 2026 18:33
8d5a82c to
49bcb6e
Compare
Expose an attribute to pass options to the direct header compiler, for example to allow JDK 24+ sun.misc.Unsafe access for TurbineDirect's bundled protobuf (protocolbuffers/protobuf#20760). Options pass through as-is. These are only meaningful for a JVM direct header compiler such as TurbineDirect's deploy jar; a native turbine_direct_graal parses them as Turbine command-line options, which the attribute docs warn against. Closes bazelbuild#374
davido
force-pushed
the
turbine-direct-unsafe-memory-access
branch
from
August 19, 2026 18:51
49bcb6e to
da635b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…iler
turbine_direct (header_compiler_direct) bundles protobuf, whose UnsafeUtil calls terminally-deprecated sun.misc.Unsafe methods. On JDK 24+ (JEP 498) the JVM prints a warning for each such call during header compilation:
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::arrayBaseOffset has been called by
com.google.protobuf.UnsafeUtil (.../java_tools/turbine_direct_binary_deploy.jar)
Unlike the Turbine worker, header_compiler_direct does not receive turbine_jvm_opts, and --jvmopt does not reach header-compilation actions, so a toolchain currently has no way to silence these warnings for the direct header compiler. Add --sun-misc-unsafe-memory-access=allow to header_compiler_direct_jvm_opts, gated on the runtime feature version since the flag is rejected on JDK <= 22.
See protocolbuffers/protobuf#20760.
Closes #374